
#ifndef _C_OBSTACLE_ANALYZE_H_
#define _C_OBSTACLE_ANALYZE_H_


#pragma once

#ifndef _INCLUDED_PCL_H_
#define _INCLUDED_PCL_H_

#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/ModelCoefficients.h>
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/features/normal_3d.h>
#include <pcl/kdtree/kdtree.h>
#include <pcl/segmentation/extract_clusters.h>

#endif

#include <boost/shared_ptr.hpp>



class CobstacleAnalyze
{
public:
	CobstacleAnalyze(void);
	virtual ~CobstacleAnalyze(void);

	class ObstClassifyer
	{
	public:
		void updateObstStaticsInfo();

		OBSTTYPE getObstType(int obstID);

	private:
		int isObst_Stair(UINT obstID);

		int isObst_Slope(UINT obstID);

		int isObst_Hollow(UINT obstID);
	};

	class ObstTracker
	{
	public:
		void trackObstacles();

	private:
		ObstDescriptor generateObstDescriptor(
			const ObstInfo& obst);

		float getObstSimilarity(
			ObstDescriptor& obst1,
			ObstDescriptor& obst2,
			float thresh = 90
			);

		void findSimilarObst(
			vector<ObstDescriptor>& vecCurrObstDescriptor,
			vector<ObstDescriptor>& vecTrackedObstDescriptor,
			vector<int>& vecSimilarIndex
			);
	};

};


#endif